import { createI18n } from "vue-i18n";
import en from './locales/en.json'
import zh from './locales/zh.json'

// 不能使用pinia，会报顺序错误
const language = localStorage.getItem('ca-language') || 'zh'
const i18n = createI18n({
  legacy:false,
  locale: language ,
  messages:{en,zh},
  fallbackLocale:'zh',
  silentTranslationWarn: true, // 关闭警告
})

export default i18n